<#if invalidContract??>
<h1>无效的合同信息</h1>
<#elseif canNotFind??>
<h1>未找到付款信息</h1>
<#else>
<div class="children-pay-modal">
	<#if Session['proj_creater']>
	<div class="children-pay-form-container hide">
		<form class="children-pay-form">
			<input type="hidden" name="contract.id" value="${data.id!''}">
			<div class="row">
				<div class="col-md-6 col-sm-6 col-xs-12">
					<div class="form-group">
						<div class="input-group">
							<div class="input-group-addon">
								<div style="width: 88px;">
									<span class="text-danger">*</span>
									<span class="title-content">付款金额</span>
								</div>
							</div>
							<input type="text" class="form-control not-null" name="amount" placeholder="请输入数字" value="${data.amount}">
						</div>
					</div>
				</div>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<div class="form-group">
						<div class="input-group">
							<div class="input-group-addon">
								<div style="width: 88px;">
									<span class="text-danger">*</span>
									<span class="title-content">付款日期</span>
								</div>
							</div>
							<input type="text" class="form-control not-null datetimepicker" name="date" data-foot="false" data-format="yyyy-MM-dd" data-time="${data.date}" placeholder="请选择日期">
						</div>
					</div>
				</div>
				<div class="col-md-12 col-sm-12 col-xs-12">
					<div class="form-group">
						<div class="input-group">
							<div class="input-group-addon">
								<div style="width: 88px;">
									<span class="title-content">备注</span>
								</div>
							</div>
							<textarea rows="2" class="form-control" name="des" placeholder="最多150个汉字">${data.des}</textarea>
						</div>
					</div>
				</div>
				<div class="col-md-12 col-sm-12 col-xs-12 text-center">
					<div class="btn btn-primary ok">添加</div>
					<div class="btn btn-danger cancel">收起</div>
				</div>
			</div>
		</form>
		<hr class="info-split">
	</div>
	</#if>
	<div class="children-pay-list-container">
		<table class="children-pay-list${Session['proj_creater']?string(' create', '')}${Session['proj_deleter']?string(' delete', '')}${Session['proj_updater']?string(' update', '')}">
			<tr class="title-row">
				<th class="text-center" width="30"></th>
				<th class="text-center">付款金额</th>
				<th class="text-center">到账日期</th>
				<th class="text-center">备注</th>
			</tr>
			<#if data.pays> <#list data.pays as p>
			<tr data-id="${p.id}">
				<td class="text-center">${p_index + 1}</td>
				<td class="text-center">${(p.amount?string('currency'))!'-'}</td>
				<td class="text-center">${(p.date?string('yyyy.MM.dd'))!'-'}</td>
				<td>${p.des!'-'}</td>
			</tr>
			</#list> </#if>
		</table>
		<hr class="info-split">
		<div>
			总计：
			<span class="total">${(data.paymentCount?string('currency'))!'-'}</span>
		</div>
	</div>
</div>
<script src="${request.contextPath}/app/project/js/children-contract-pay.js"></script>
</#if>
